Skip to content

v4.1.x: fix a memory hook recursion hang#9276

Merged
jsquyres merged 1 commit intoopen-mpi:v4.1.xfrom
awlauria:mem_recursion_v4.1.x
Aug 29, 2021
Merged

v4.1.x: fix a memory hook recursion hang#9276
jsquyres merged 1 commit intoopen-mpi:v4.1.xfrom
awlauria:mem_recursion_v4.1.x

Conversation

@awlauria
Copy link
Contributor

Without this checkin, it's possible for a stack trace like the following
to occur:

free()
madvise()
intercept_madvise()
opal_mem_hooks_release_hook(), loop of registered callbacks which includes
ompi_mtl_mxm_mem_release_cb()
mxm_mem_unmap(,,from_alloc=false)
...
free()

The problem is since we're already in glibc free() we need to call the
release callback with from_alloc=true so it will take a more conservative
path and only record the memory being released without making any malloc/free
calls.

Signed-off-by: Austen Lauria awlauria@us.ibm.com
(cherry picked from commit d620ad1)

Without this checkin, it's possible for a stack trace like the following
to occur:

free()
 madvise()
  intercept_madvise()
   opal_mem_hooks_release_hook(), loop of registered callbacks which includes
    ompi_mtl_mxm_mem_release_cb()
     mxm_mem_unmap(,,from_alloc=false)
      ...
       free()

The problem is since we're already in glibc free() we need to call the
release callback with from_alloc=true so it will take a more conservative
path and only record the memory being released without making any malloc/free
calls.

Signed-off-by: Austen Lauria <awlauria@us.ibm.com>
(cherry picked from commit d620ad1)
@awlauria awlauria added this to the v4.1.2 milestone Aug 18, 2021
@awlauria awlauria requested a review from wckzhang August 23, 2021 19:35
@jsquyres jsquyres merged commit 17c3b49 into open-mpi:v4.1.x Aug 29, 2021
@awlauria awlauria deleted the mem_recursion_v4.1.x branch March 17, 2022 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants